package org.jsbd.boss.service.impl;

import javax.annotation.Resource;

import org.jsbd.boss.domian.channel.SimulatorActionLog;
import org.jsbd.boss.service.ISimulatorService;
import org.jsbd.boss.util.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import edu.hziee.common.queue.DelayExecuteBuffer;

@Service
public class SimulatorServiceImpl implements ISimulatorService {
	public static final Logger LOGGER = LoggerFactory.getLogger(SimulatorServiceImpl.class);

	@Resource(name = "simulatorActionLogBuffer")
	private DelayExecuteBuffer<SimulatorActionLog> simulatorActionLogBuffer;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.jsbd.boss.service.ISimulatorService#batchInsert(org.jsbd.boss.domian
	 * .channel.SimulatorActionLog)
	 */
	@Override
	public boolean batchInsert(SimulatorActionLog log) {
		log.setCurrentDate(DateUtil.getCurrentDateStr());
		return simulatorActionLogBuffer.add(log);
	}

}
